﻿namespace HRM.CORE.REPORT
{
    using DevExpress.Utils;
    using DevExpress.XtraBars;
    using DevExpress.XtraEditors;
    using DevExpress.XtraEditors.Controls;
    using DevExpress.XtraGrid.Columns;
    using DevExpress.XtraGrid.Views.Grid;
    using DevExpress.XtraReports.UI;
    using DevExpress.XtraTreeList;
    using DevExpress.XtraTreeList.Columns;
    using APP.HELPER;
    using Common.Class; using APP.HELPER.Utils.Language; using Security.Security; using Dictionary.ERP;
    using Common.Report;
    using HRM.CORE;
    using Extra;
    
    using System; using Extra.ERP;
    using System.ComponentModel;
    using System.Drawing;
    using System.Drawing.Drawing2D;
    using System.Windows.Forms; using Common;
    using APP.HELPER.Utils;

    public class xucOptionPrintEmployee : Common.xucBaseOptionPrint
    {
        private ComboBoxEdit cboMonth;
        private ComboBoxEdit cboQuarter;
        private Common.Class.clsAllOption clsAllOption;
        private GridColumn colEmployeeCode;
        private GridColumn colFirstName;
        private GridColumn colLastName;
        private TreeListColumn colName;
        private TreeListColumn colValue;
        private IContainer components;
        private GridLookUpEdit gbEmployee;
        private GridView gbList;
        private GroupControl groupControl1;
        private GroupControl groupControl2;
        private DevExpress.Utils.ImageCollection imageCollection1;
        private LabelControl labelControl1;
        private LabelControl labelControl2;
        private LabelControl labelControl3;
        private LabelControl labelControl4;
        private LabelControl labelControl5;
        private string m_Code;
        private string m_EmployeeCode;
        private int m_Level;
        private int m_Month;
        private int m_Quarter;
        private int m_Value;
        private int m_Year;
        private TimeEdit teYear;
        private TreeList treeList1;
        private TextEdit txtEmployeeName;
        private xucOrganizationEdit xucOrganizationEdit1;

        public xucOptionPrintEmployee()
        {
            this.m_Level = 0;
            this.m_Code = "";
            this.m_EmployeeCode = "";
            this.m_Value = 0;
            this.m_Month = System.DateTime.Now.Month;
            this.m_Quarter = 1;
            this.m_Year = System.DateTime.Now.Year;
            this.clsAllOption = new Common.Class.clsAllOption();
            this.components = null;
            this.InitializeComponent();
        }

        public xucOptionPrintEmployee(int Level, string Code, string EmployeeCode)
        {
            this.m_Level = 0;
            this.m_Code = "";
            this.m_EmployeeCode = "";
            this.m_Value = 0;
            this.m_Month = System.DateTime.Now.Month;
            this.m_Quarter = 1;
            this.m_Year = System.DateTime.Now.Year;
            this.clsAllOption = new Common.Class.clsAllOption();
            this.components = null;
            this.InitializeComponent();
            this.m_Level = Level;
            this.m_Code = Code;
            this.m_EmployeeCode = EmployeeCode;
            this.Init();
        }

        protected override void Cancel()
        {
            base.ParentForm.Close();
        }

        private void cboMonth_SelectedIndexChanged(object sender, EventArgs e)
        {
            this.m_Month = this.cboMonth.SelectedIndex + 1;
            this.cboQuarter.SelectedIndex = MyDateTime.QuarterFromMonth(this.m_Month) - 1;
        }

        private void cboQuarter_SelectedValueChanged(object sender, EventArgs e)
        {
            this.m_Quarter = this.cboQuarter.SelectedIndex + 1;
            this.cboMonth.SelectedIndex = MyDateTime.MonthFromQuarter(this.m_Quarter, this.m_Month) - 1;
        }

        protected override void Dispose(bool disposing)
        {
            if (disposing && (this.components != null))
            {
                this.components.Dispose();
            }
            base.Dispose(disposing);
        }

        private void gbEmployee_EditValueChanged(object sender, EventArgs e)
        {
            this.m_EmployeeCode = this.gbEmployee.EditValue.ToString();
            HRM_EMPLOYEE hrm_employee = new HRM_EMPLOYEE();
            hrm_employee.Get(this.m_EmployeeCode);
            this.txtEmployeeName.Text = hrm_employee.FirstName + " " + hrm_employee.LastName;
        }

        private void Init()
        {
            this.cboMonth.SelectedIndex = this.clsAllOption.MonthDefault.Month - 1;
            this.teYear.EditValue = this.clsAllOption.MonthDefault;
            this.colValue.Visible = false;
            this.colName.OptionsColumn.AllowEdit = false;
            this.colName.OptionsColumn.ReadOnly = true;
            this.treeList1.ExpandAll();
            this.xucOrganizationEdit1.LoadData(this.m_Level, this.m_Code);
            this.gbEmployee.Properties.DataSource = new HRM_EMPLOYEE().GetListCurrentNow(this.m_Level, this.m_Code, -1);
            if (this.m_EmployeeCode != "")
            {
                this.gbEmployee.EditValue = this.m_EmployeeCode;
            }
        }

        private void InitializeComponent()
        {
            this.components = new Container();
            ComponentResourceManager manager = new ComponentResourceManager(typeof(xucOptionPrintEmployee));
            MenuButton button = new MenuButton();
            ItemCommand command = new ItemCommand();
            ItemCommand command2 = new ItemCommand();
            ItemCommand command3 = new ItemCommand();
            ItemCommand command4 = new ItemCommand();
            ItemCommand command5 = new ItemCommand();
            ItemCommand command6 = new ItemCommand();
            ItemCommand command7 = new ItemCommand();
            ItemCommand command8 = new ItemCommand();
            ItemCommand command9 = new ItemCommand();
            ItemCommand command10 = new ItemCommand();
            ItemCommand command11 = new ItemCommand();
            ItemCommand command12 = new ItemCommand();
            ItemCommand command13 = new ItemCommand();
            ItemCommand command14 = new ItemCommand();
            ItemCommand command15 = new ItemCommand();
            ItemCommand command16 = new ItemCommand();
            ItemCommand command17 = new ItemCommand();
            ItemCommand command18 = new ItemCommand();
            ItemCommand command19 = new ItemCommand();
            ItemCommand command20 = new ItemCommand();
            ItemCommand command21 = new ItemCommand();
            ItemCommand command22 = new ItemCommand();
            ItemCommand command23 = new ItemCommand();
            ItemCommand command24 = new ItemCommand();
            ItemCommand command25 = new ItemCommand();
            ItemCommand command26 = new ItemCommand();
            ItemCommand command27 = new ItemCommand();
            ItemCommand command28 = new ItemCommand();
            ItemCommand command29 = new ItemCommand();
            this.groupControl1 = new GroupControl();
            this.treeList1 = new TreeList();
            this.colName = new TreeListColumn();
            this.colValue = new TreeListColumn();
            this.imageCollection1 = new DevExpress.Utils.ImageCollection(this.components);
            this.txtEmployeeName = new TextEdit();
            this.gbEmployee = new GridLookUpEdit();
            this.gbList = new GridView();
            this.colEmployeeCode = new GridColumn();
            this.colFirstName = new GridColumn();
            this.colLastName = new GridColumn();
            this.teYear = new TimeEdit();
            this.cboQuarter = new ComboBoxEdit();
            this.cboMonth = new ComboBoxEdit();
            this.labelControl4 = new LabelControl();
            this.xucOrganizationEdit1 = new xucOrganizationEdit();
            this.labelControl5 = new LabelControl();
            this.labelControl3 = new LabelControl();
            this.labelControl2 = new LabelControl();
            this.labelControl1 = new LabelControl();
            this.groupControl2 = new GroupControl();
            this.groupControl1.BeginInit();
            this.groupControl1.SuspendLayout();
            this.treeList1.BeginInit();
            this.imageCollection1.BeginInit();
            this.txtEmployeeName.Properties.BeginInit();
            this.gbEmployee.Properties.BeginInit();
            this.gbList.BeginInit();
            this.teYear.Properties.BeginInit();
            this.cboQuarter.Properties.BeginInit();
            this.cboMonth.Properties.BeginInit();
            this.groupControl2.BeginInit();
            this.groupControl2.SuspendLayout();
            base.SuspendLayout();
            base.btnPrintPreview.Location = new Point(0x24d, 0x164);
            base.btnPrint.Location = new Point(0x1fa, 0x164);
            base.btnCancel.Location = new Point(0x1a0, 0x164);
            this.groupControl1.Controls.Add(this.treeList1);
            this.groupControl1.Location = new Point(8, 9);
            this.groupControl1.Name = "groupControl1";
            this.groupControl1.Size = new Size(0x16f, 0x151);
            this.groupControl1.TabIndex = 0x2f;
            this.groupControl1.Text = "Chọn loại b\x00e1o c\x00e1o cần in";
            this.treeList1.Appearance.FocusedCell.BackColor = Color.Orange;
            this.treeList1.Appearance.FocusedCell.BackColor2 = Color.White;
            this.treeList1.Appearance.FocusedCell.GradientMode = LinearGradientMode.BackwardDiagonal;
            this.treeList1.Appearance.FocusedCell.Options.UseBackColor = true;
            this.treeList1.BorderStyle = BorderStyles.NoBorder;
            this.treeList1.Columns.AddRange(new TreeListColumn[] { this.colName, this.colValue });
            this.treeList1.Dock = DockStyle.Fill;
            this.treeList1.Location = new Point(2, 0x16);
            this.treeList1.Name = "treeList1";
            this.treeList1.BeginUnboundLoad();
            this.treeList1.AppendNode(new object[] { "Hồ sơ nh\x00e2n vi\x00ean", "0" }, -1, 3, 3, -1);
            this.treeList1.AppendNode(new object[] { "Danh s\x00e1ch nh\x00e2n vi\x00ean theo ph\x00f2ng ban", "1" }, 0, 2, 2, -1);
            this.treeList1.AppendNode(new object[] { "Danh s\x00e1ch nh\x00e2n vi\x00ean theo ph\x00f2ng ban (c\x00f3 h\x00ecnh)", "15" }, 0, 2, 2, -1);
            this.treeList1.AppendNode(new object[] { "Phiếu th\x00f4ng tin theo nh\x00e2n vi\x00ean theo ph\x00f2ng ban", "2" }, 0, 2, 2, -1);
            this.treeList1.AppendNode(new object[] { "Phiếu th\x00f4ng tin theo nh\x00e2n vi\x00ean được chọn", "3" }, 0, 2, 2, -1);
            this.treeList1.AppendNode(new object[] { "Danh s\x00e1ch lao động tăng theo th\x00e1ng được chọn", "4" }, 0, 2, 2, -1);
            this.treeList1.AppendNode(new object[] { "Danh s\x00e1ch lao động tăng theo năm được chọn", "5" }, 0, 2, 2, -1);
            this.treeList1.AppendNode(new object[] { "Danh s\x00e1ch lao động giảm theo th\x00e1ng được chọn", "6" }, 0, 2, 2, -1);
            this.treeList1.AppendNode(new object[] { "Danh s\x00e1ch lao động giảm theo năm được chọn", "7" }, 0, 2, 2, -1);
            this.treeList1.AppendNode(new object[] { "Danh s\x00e1ch lương CBCN-VC lao động", "8" }, 0, 2, 2, -1);
            this.treeList1.AppendNode(new object[] { "In thẻ nh\x00e2n vi\x00ean theo ph\x00f2ng ban", "16" }, 0, 2, 2, -1);
            this.treeList1.AppendNode(new object[] { "In thẻ theo nh\x00e2n vi\x00ean được chọn", "17" }, 0, 2, 2, -1);
            this.treeList1.AppendNode(new object[] { "Đ\x00e1nh gi\x00e1, xếp loại nh\x00e2n vi\x00ean", "9" }, -1, 3, 3, -1);
            this.treeList1.AppendNode(new object[] { "Danh s\x00e1ch đ\x00e1nh gi\x00e1 xếp loại CB - CNV", "10" }, 12, 2, 2, -1);
            this.treeList1.AppendNode(new object[] { "B\x00e1o c\x00e1o kết quả đ\x00e1nh gi\x00e1 xếp loại CB - CNV", "11" }, 12, 2, 2, -1);
            this.treeList1.AppendNode(new object[] { "Bảng TH kết quả đ\x00e1nh gi\x00e1, xếp loại CB - CNV theo th\x00e1ng", "12" }, 12, 2, 2, -1);
            this.treeList1.AppendNode(new object[] { "Bảng TH kết quả đ\x00e1nh gi\x00e1, xếp loại CB - CNV theo qu\x00fd", "13" }, 12, 2, 2, -1);
            this.treeList1.AppendNode(new object[] { "Bảng TH kết quả đ\x00e1nh gi\x00e1, xếp loại CB - CNV theo năm", "14" }, 12, 2, 2, -1);
            this.treeList1.EndUnboundLoad();
            this.treeList1.OptionsBehavior.PopulateServiceColumns = true;
            this.treeList1.OptionsView.ShowColumns = false;
            this.treeList1.OptionsView.ShowHorzLines = false;
            this.treeList1.OptionsView.ShowIndicator = false;
            this.treeList1.OptionsView.ShowVertLines = false;
            this.treeList1.SelectImageList = this.imageCollection1;
            this.treeList1.Size = new Size(0x16b, 0x139);
            this.treeList1.TabIndex = 40;
            this.treeList1.FocusedNodeChanged += new FocusedNodeChangedEventHandler(this.treeList1_FocusedNodeChanged);
            this.colName.Caption = "T\x00ean b\x00e1o c\x00e1o";
            this.colName.FieldName = "Name";
            this.colName.MinWidth = 0x37;
            this.colName.Name = "colName";
            this.colName.Visible = true;
            this.colName.VisibleIndex = 0;
            this.colValue.Caption = "Gi\x00e1 trị";
            this.colValue.FieldName = "Value";
            this.colValue.Name = "colValue";
            this.colValue.Visible = true;
            this.colValue.VisibleIndex = 1;
            this.imageCollection1.ImageStream = (ImageCollectionStreamer) manager.GetObject("imageCollection1.ImageStream");
            this.imageCollection1.Images.SetKeyName(0, "ico_alpha_Search_16x16.png");
            this.imageCollection1.Images.SetKeyName(1, "ico_alpha_Delete_16x16.png");
            this.imageCollection1.Images.SetKeyName(2, "document2.png");
            this.imageCollection1.Images.SetKeyName(3, "open-16x16.png");
            this.txtEmployeeName.Enabled = false;
            this.txtEmployeeName.Location = new Point(0x4c, 0x56);
            this.txtEmployeeName.Name = "txtEmployeeName";
            this.txtEmployeeName.Size = new Size(0xdb, 20);
            this.txtEmployeeName.TabIndex = 0x2e;
            this.gbEmployee.Location = new Point(0x4c, 60);
            this.gbEmployee.Name = "gbEmployee";
            this.gbEmployee.Properties.Buttons.AddRange(new EditorButton[] { new EditorButton(ButtonPredefines.Combo) });
            this.gbEmployee.Properties.DisplayMember = "EmployeeCode";
            this.gbEmployee.Properties.NullText = "[Chọn nh\x00e2n vi\x00ean]";
            this.gbEmployee.Properties.ValueMember = "EmployeeCode";
            this.gbEmployee.Properties.View = this.gbList;
            this.gbEmployee.Size = new Size(0xdb, 20);
            this.gbEmployee.TabIndex = 0x2d;
            this.gbEmployee.EditValueChanged += new EventHandler(this.gbEmployee_EditValueChanged);
            this.gbList.Columns.AddRange(new GridColumn[] { this.colEmployeeCode, this.colFirstName, this.colLastName });
            this.gbList.FocusRectStyle = DrawFocusRectStyle.RowFocus;
            this.gbList.Name = "gbList";
            this.gbList.OptionsSelection.EnableAppearanceFocusedCell = false;
            this.gbList.OptionsView.ShowGroupPanel = false;
            this.colEmployeeCode.Caption = "M\x00e3 nh\x00e2n vi\x00ean";
            this.colEmployeeCode.FieldName = "EmployeeCode";
            this.colEmployeeCode.Name = "colEmployeeCode";
            this.colEmployeeCode.Visible = true;
            this.colEmployeeCode.VisibleIndex = 0;
            this.colFirstName.Caption = "Họ l\x00f3t";
            this.colFirstName.FieldName = "FirstName";
            this.colFirstName.Name = "colFirstName";
            this.colFirstName.Visible = true;
            this.colFirstName.VisibleIndex = 1;
            this.colLastName.Caption = "T\x00ean";
            this.colLastName.FieldName = "LastName";
            this.colLastName.Name = "colLastName";
            this.colLastName.Visible = true;
            this.colLastName.VisibleIndex = 2;
            this.teYear.EditValue = new System.DateTime(0x7dc, 7, 0x12, 0, 0, 0, 0);
            this.teYear.Location = new Point(0x4c, 0xb6);
            this.teYear.Name = "teYear";
            this.teYear.Properties.Appearance.Options.UseTextOptions = true;
            this.teYear.Properties.Appearance.TextOptions.HAlignment = HorzAlignment.Far;
            this.teYear.Properties.Buttons.AddRange(new EditorButton[] { new EditorButton() });
            this.teYear.Properties.Mask.EditMask = "yyyy";
            this.teYear.Size = new Size(0xdb, 20);
            this.teYear.TabIndex = 0x2b;
            this.teYear.EditValueChanging += new ChangingEventHandler(this.teYear_EditValueChanging);
            this.cboQuarter.Location = new Point(0x4c, 0x9c);
            this.cboQuarter.Name = "cboQuarter";
            this.cboQuarter.Properties.Buttons.AddRange(new EditorButton[] { new EditorButton(ButtonPredefines.Combo) });
            this.cboQuarter.Properties.Items.AddRange(new object[] { "Qu\x00fd I", "Qu\x00fd II", "Qu\x00fd III", "Qu\x00fd IV" });
            this.cboQuarter.Properties.TextEditStyle = TextEditStyles.DisableTextEditor;
            this.cboQuarter.Size = new Size(0xdb, 20);
            this.cboQuarter.TabIndex = 0x2a;
            this.cboQuarter.SelectedIndexChanged += new EventHandler(this.cboQuarter_SelectedValueChanged);
            this.cboMonth.Location = new Point(0x4c, 130);
            this.cboMonth.Name = "cboMonth";
            this.cboMonth.Properties.Buttons.AddRange(new EditorButton[] { new EditorButton(ButtonPredefines.Combo) });
            this.cboMonth.Properties.Items.AddRange(new object[] { "Th\x00e1ng 1", "Th\x00e1ng 2", "Th\x00e1ng 3", "Th\x00e1ng 4", "Th\x00e1ng 5", "Th\x00e1ng 6", "Th\x00e1ng 7", "Th\x00e1ng 8", "Th\x00e1ng 9", "Th\x00e1ng 10", "Th\x00e1ng 11", "Th\x00e1ng 12" });
            this.cboMonth.Properties.TextEditStyle = TextEditStyles.DisableTextEditor;
            this.cboMonth.Size = new Size(0xdb, 20);
            this.cboMonth.TabIndex = 0x29;
            this.cboMonth.SelectedIndexChanged += new EventHandler(this.cboMonth_SelectedIndexChanged);
            this.labelControl4.Location = new Point(8, 0x1f);
            this.labelControl4.Name = "labelControl4";
            this.labelControl4.Size = new Size(0x3d, 13);
            this.labelControl4.TabIndex = 0x27;
            this.labelControl4.Text = "Chọn đơn vị:";
            this.xucOrganizationEdit1.BranchCode = null;
            this.xucOrganizationEdit1.Code = null;
            this.xucOrganizationEdit1.DepartmentCode = null;
            this.xucOrganizationEdit1.EmployeeCode = null;
            this.xucOrganizationEdit1.GroupCode = null;
            this.xucOrganizationEdit1.IsClose = CloseOrNew.None;
            this.xucOrganizationEdit1.Level = 0;
            this.xucOrganizationEdit1.Location = new Point(0x4c, 0x1d);
            this.xucOrganizationEdit1.Name = "xucOrganizationEdit1";
            this.xucOrganizationEdit1.NotSave = false;
            command.Caption = "";
            command.Enable = false;
            command.Visibility = BarItemVisibility.Never;
            button.Add = command;
            command2.Caption = "";
            command2.Enable = false;
            command2.Visibility = BarItemVisibility.Never;
            button.Cancel = command2;
            command3.Caption = "";
            command3.Enable = false;
            command3.Visibility = BarItemVisibility.Never;
            button.Change = command3;
            command4.Caption = "";
            command4.Enable = false;
            command4.Visibility = BarItemVisibility.Never;
            button.Close = command4;
            command5.Caption = "";
            command5.Enable = false;
            command5.Visibility = BarItemVisibility.Never;
            button.Custom = command5;
            command6.Caption = "";
            command6.Enable = false;
            command6.Visibility = BarItemVisibility.Never;
            button.Delete = command6;
            command7.Caption = "";
            command7.Enable = false;
            command7.Visibility = BarItemVisibility.Never;
            button.Export = command7;
            command8.Caption = "";
            command8.Enable = false;
            command8.Visibility = BarItemVisibility.Never;
            button.Filter = command8;
            command9.Caption = "";
            command9.Enable = false;
            command9.Visibility = BarItemVisibility.Never;
            button.FilterCustomer = command9;
            command10.Caption = "";
            command10.Enable = false;
            command10.Visibility = BarItemVisibility.Never;
            button.FilterStock = command10;
            command11.Caption = "";
            command11.Enable = false;
            command11.Visibility = BarItemVisibility.Never;
            button.Find = command11;
            button.GClose = false;
            button.GCommand = false;
            button.GExport = false;
            command12.Caption = "";
            command12.Enable = false;
            command12.Visibility = BarItemVisibility.Never;
            button.Go = command12;
            button.GOption = false;
            button.GPrint = false;
            button.GRecords = false;
            button.GSearchBar = false;
            button.GSettings = false;
            button.GVaildation = false;
            command13.Caption = "";
            command13.Enable = false;
            command13.Visibility = BarItemVisibility.Never;
            button.Import = command13;
            command14.Caption = "";
            command14.Enable = false;
            command14.Visibility = BarItemVisibility.Never;
            button.Next = command14;
            command15.Caption = "";
            command15.Enable = false;
            command15.Visibility = BarItemVisibility.Never;
            button.PageSetup = command15;
            button.PHome = false;
            command16.Caption = "";
            command16.Enable = false;
            command16.Visibility = BarItemVisibility.Never;
            button.Previous = command16;
            command17.Caption = "";
            command17.Enable = false;
            command17.Visibility = BarItemVisibility.Never;
            button.Print = command17;
            command18.Caption = "";
            command18.Enable = false;
            command18.Visibility = BarItemVisibility.Never;
            button.PrintPreview = command18;
            button.PTool = false;
            command19.Caption = "";
            command19.Enable = false;
            command19.Visibility = BarItemVisibility.Never;
            button.Redo = command19;
            command20.Caption = "";
            command20.Enable = false;
            command20.Visibility = BarItemVisibility.Never;
            button.Refresh = command20;
            command21.Caption = "";
            command21.Enable = false;
            command21.Visibility = BarItemVisibility.Never;
            button.Save = command21;
            command22.Caption = "";
            command22.Enable = false;
            command22.Visibility = BarItemVisibility.Never;
            button.SaveAndClose = command22;
            command23.Caption = "";
            command23.Enable = false;
            command23.Visibility = BarItemVisibility.Never;
            button.SaveAndNew = command23;
            command24.Caption = "";
            command24.Enable = false;
            command24.Visibility = BarItemVisibility.Never;
            button.Search = command24;
            command25.Caption = "";
            command25.Enable = false;
            command25.Visibility = BarItemVisibility.Never;
            button.SearchText = command25;
            command26.Caption = "";
            command26.Enable = false;
            command26.Visibility = BarItemVisibility.Never;
            button.Task = command26;
            command27.Caption = "";
            command27.Enable = false;
            command27.Visibility = BarItemVisibility.Never;
            button.Undo = command27;
            command28.Caption = "";
            command28.Enable = false;
            command28.Visibility = BarItemVisibility.Never;
            button.Vaildate = command28;
            command29.Caption = "";
            command29.Enable = false;
            command29.Visibility = BarItemVisibility.Never;
            button.View = command29;
            this.xucOrganizationEdit1.RibbonBar = button;
            this.xucOrganizationEdit1.Size = new Size(0xdb, 0x16);
            this.xucOrganizationEdit1.Status = Actions.None;
            this.xucOrganizationEdit1.TabIndex = 0x26;
            this.xucOrganizationEdit1.Title = "";
            this.xucOrganizationEdit1.DepartmentSelected += new xucOrganizationEdit.DepartmentSelectedHandler(this.xucOrganizationEdit1_DepartmentSelected);
            this.labelControl5.Location = new Point(7, 0xb7);
            this.labelControl5.Name = "labelControl5";
            this.labelControl5.Size = new Size(0x34, 13);
            this.labelControl5.TabIndex = 13;
            this.labelControl5.Text = "Chọn năm:";
            this.labelControl3.Location = new Point(9, 0x9e);
            this.labelControl3.Name = "labelControl3";
            this.labelControl3.Size = new Size(50, 13);
            this.labelControl3.TabIndex = 13;
            this.labelControl3.Text = "Chọn qu\x00fd:";
            this.labelControl2.Appearance.Options.UseTextOptions = true;
            this.labelControl2.Appearance.TextOptions.WordWrap = WordWrap.Wrap;
            this.labelControl2.AutoSizeMode = LabelAutoSizeMode.None;
            this.labelControl2.Location = new Point(8, 0x3b);
            this.labelControl2.Name = "labelControl2";
            this.labelControl2.Size = new Size(0x3d, 0x22);
            this.labelControl2.TabIndex = 13;
            this.labelControl2.Text = "Chọn nh\x00e2n vi\x00ean:";
            this.labelControl1.Location = new Point(9, 0x84);
            this.labelControl1.Name = "labelControl1";
            this.labelControl1.Size = new Size(60, 13);
            this.labelControl1.TabIndex = 13;
            this.labelControl1.Text = "Chọn th\x00e1ng:";
            this.groupControl2.Controls.Add(this.xucOrganizationEdit1);
            this.groupControl2.Controls.Add(this.txtEmployeeName);
            this.groupControl2.Controls.Add(this.teYear);
            this.groupControl2.Controls.Add(this.labelControl2);
            this.groupControl2.Controls.Add(this.labelControl4);
            this.groupControl2.Controls.Add(this.cboQuarter);
            this.groupControl2.Controls.Add(this.gbEmployee);
            this.groupControl2.Controls.Add(this.cboMonth);
            this.groupControl2.Controls.Add(this.labelControl5);
            this.groupControl2.Controls.Add(this.labelControl3);
            this.groupControl2.Controls.Add(this.labelControl1);
            this.groupControl2.Location = new Point(0x17d, 9);
            this.groupControl2.Name = "groupControl2";
            this.groupControl2.Size = new Size(0x12e, 0x151);
            this.groupControl2.TabIndex = 0x30;
            this.groupControl2.Text = "T\x00f9y chọn";
            base.AutoScaleDimensions = new SizeF(6f, 13f);
            base.AutoScaleMode = AutoScaleMode.Font;
            base.Controls.Add(this.groupControl2);
            base.Controls.Add(this.groupControl1);
            base.Name = "xucOptionPrintEmployee";
            base.Size = new Size(690, 0x18b);
            base.Controls.SetChildIndex(base.btnPrintPreview, 0);
            base.Controls.SetChildIndex(base.btnPrint, 0);
            base.Controls.SetChildIndex(base.btnCancel, 0);
            base.Controls.SetChildIndex(this.groupControl1, 0);
            base.Controls.SetChildIndex(this.groupControl2, 0);
            this.groupControl1.EndInit();
            this.groupControl1.ResumeLayout(false);
            this.treeList1.EndInit();
            this.imageCollection1.EndInit();
            this.txtEmployeeName.Properties.EndInit();
            this.gbEmployee.Properties.EndInit();
            this.gbList.EndInit();
            this.teYear.Properties.EndInit();
            this.cboQuarter.Properties.EndInit();
            this.cboMonth.Properties.EndInit();
            this.groupControl2.EndInit();
            this.groupControl2.ResumeLayout(false);
            this.groupControl2.PerformLayout();
            base.ResumeLayout(false);
        }

        protected override void Print()
        {
            this.Print(false);
        }

        private void Print(bool IsPrintPreview)
        {
            this.m_Level = this.xucOrganizationEdit1.Level;
            this.m_Code = this.xucOrganizationEdit1.Code;
            XtraReport xtraReport = new XtraReport();
            xfmReport report2 = new xfmReport();
            switch (this.m_Value)
            {
                case 0:
                    if (!(this.m_EmployeeCode == ""))
                    {
                        new xfmOptionPrintEmployeeCV(this.m_EmployeeCode).ShowDialog();
                        return;
                    }
                    XtraMessageBox.Show("Vui l\x00f2ng chọn nh\x00e2n vi\x00ean từ lưới danh s\x00e1ch!", "Th\x00f4ng B\x00e1o", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
                    return;

                case 1:
                    xtraReport = new rptListEmployee(this.m_Level, this.m_Code);
                    report2.SetTitle("Danh S\x00e1ch Nh\x00e2n Vi\x00ean Theo Ph\x00f2ng Ban");
                    break;

                case 2:
                    xtraReport = new rptEmployee(this.m_Level, this.m_Code);
                    report2.SetTitle("Phiếu Th\x00f4ng Tin Nh\x00e2n Vi\x00ean Theo Ph\x00f2ng Ban");
                    break;

                case 3:
                    if (!(this.m_EmployeeCode == ""))
                    {
                        xtraReport = new rptEmployee(this.m_EmployeeCode);
                        report2.SetTitle("Phiếu Th\x00f4ng Tin Nh\x00e2n Vi\x00ean");
                        break;
                    }
                    XtraMessageBox.Show("Vui l\x00f2ng chọn nh\x00e2n vi\x00ean từ lưới danh s\x00e1ch!", "Th\x00f4ng B\x00e1o", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
                    return;

                case 4:
                    xtraReport = new rptListIncreaseEmployee(this.m_Level, this.m_Code, 0, this.m_Month, this.m_Year);
                    report2.SetTitle("Danh S\x00e1ch Lao Động Tăng Th\x00e1ng " + this.m_Month.ToString() + "/" + this.m_Year.ToString());
                    break;

                case 5:
                    xtraReport = new rptListIncreaseEmployee(this.m_Level, this.m_Code, 1, this.m_Month, this.m_Year);
                    report2.SetTitle("Danh S\x00e1ch Lao Động Tăng Năm " + this.m_Year.ToString());
                    break;

                case 6:
                    xtraReport = new rptListDecreaseEmployee(this.m_Level, this.m_Code, 2, this.m_Month, this.m_Year);
                    report2.SetTitle("Danh S\x00e1ch Lao Động Giảm Th\x00e1ng " + this.m_Month.ToString() + "/" + this.m_Year.ToString());
                    break;

                case 7:
                    xtraReport = new rptListDecreaseEmployee(this.m_Level, this.m_Code, 3, this.m_Month, this.m_Year);
                    report2.SetTitle("Danh S\x00e1ch Lao Động Giảm Năm " + this.m_Year.ToString());
                    break;

                case 8:
                    xtraReport = new rptListSalaryEmployee(this.m_Level, this.m_Code);
                    report2.SetTitle("Danh S\x00e1ch Lương CBCNVC-LĐ Theo Ph\x00f2ng Ban");
                    break;

                case 9:
                    xtraReport = new rptReportRate2(this.m_Level, this.m_Code, this.m_Month, this.m_Year);
                    report2.SetTitle("Danh S\x00e1ch Đ\x00e1nh Gi\x00e1 Xếp Loại CB - CNV");
                    break;

                case 10:
                    xtraReport = new rptReportRate2(this.m_Level, this.m_Code, this.m_Month, this.m_Year);
                    report2.SetTitle("Danh S\x00e1ch Đ\x00e1nh Gi\x00e1 Xếp Loại CB - CNV");
                    break;

                case 11:
                    xtraReport = new rptReportRate3(this.m_Level, this.m_Code, this.m_Month, this.m_Year);
                    report2.SetTitle("B\x00e1o C\x00e1o Kết Quả Đ\x00e1nh Gi\x00e1 Xếp Loại CB - CNV");
                    break;

                case 12:
                    xtraReport = new rptReportRate1(this.m_Level, this.m_Code, this.m_Month, this.m_Year);
                    report2.SetTitle("Bảng TH Kết Quả Đ\x00e1nh Gi\x00e1 Xếp Loại CB - CNV Theo Th\x00e1ng");
                    break;

                case 13:
                    xtraReport = new rptReportRate4(this.m_Level, this.m_Code, this.m_Quarter, this.m_Year);
                    report2.SetTitle("Bảng TH Kết Quả Đ\x00e1nh Gi\x00e1 Xếp Loại CB - CNV Theo Qu\x00fd");
                    break;

                case 14:
                    xtraReport = new rptReportRate5(this.m_Level, this.m_Code, this.m_Year);
                    report2.SetTitle("Bảng TH Kết Quả Đ\x00e1nh Gi\x00e1 Xếp Loại CB - CNV Theo Năm");
                    break;

                case 15:
                    xtraReport = new rptListEmployee1(this.m_Level, this.m_Code);
                    report2.SetTitle("Danh S\x00e1ch Nh\x00e2n Vi\x00ean Theo Ph\x00f2ng Ban");
                    break;

                case 0x10:
                    xtraReport = new rptEmployeeCard(this.m_Level, this.m_Code);
                    report2.SetTitle("Thẻ Nh\x00e2n Vi\x00ean Theo Ph\x00f2ng Ban");
                    break;

                case 0x11:
                    if (!(this.m_EmployeeCode == ""))
                    {
                        xtraReport = new rptEmployeeCard(this.m_EmployeeCode);
                        report2.SetTitle("Thẻ Nh\x00e2n Vi\x00ean");
                        break;
                    }
                    XtraMessageBox.Show("Vui l\x00f2ng chọn nh\x00e2n vi\x00ean từ lưới danh s\x00e1ch!", "Th\x00f4ng B\x00e1o", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
                    return;
            }
            if (IsPrintPreview)
            {
                report2.ShowPrintPreview(xtraReport);
            }
            else
            {
                PrintDialog dialog = new PrintDialog();
                if (dialog.ShowDialog() == DialogResult.OK)
                {
                    string printerName = dialog.PrinterSettings.PrinterName;
                    xtraReport.Print(printerName);
                }
            }
        }

        protected override void PrintPreview()
        {
            this.Print(true);
        }

        private void teYear_EditValueChanging(object sender, ChangingEventArgs e)
        {
            try
            {
                this.m_Year = Convert.ToDateTime(e.NewValue.ToString()).Year;
            }
            catch
            {
            }
        }

        private void treeList1_FocusedNodeChanged(object sender, FocusedNodeChangedEventArgs e)
        {
            try
            {
                this.m_Value = Convert.ToInt32(e.Node.GetValue(this.colValue).ToString());
            }
            catch
            {
            }
        }

        private void xucOrganizationEdit1_DepartmentSelected(object sender, Organization Item)
        {
            this.gbEmployee.Properties.DataSource = new HRM_EMPLOYEE().GetListCurrentNow(Item.Level, Item.Code, -1);
            if (this.m_EmployeeCode != "")
            {
                this.gbEmployee.EditValue = this.m_EmployeeCode;
            }
        }
    }
}

